package com.apes.autoparts.parts.repository;

import com.apes.autoparts.parts.model.Part;
import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.List;

public interface PartRepository extends CustomRepository<Part, String> {


    @Query(value = "select distinct t.sub_group_id from auto_part t where t.sub_group_id in :subGroupIds " +
            "           and t.create_date > :timestamp", nativeQuery = true)
    List<String> findPartBySubGroupId(@Param("subGroupIds") List<String> subGroupIds, @Param("timestamp")Timestamp timestamp);
}
